#include <fcntl.h>
#include <unistd.h>

int main(int argc, const char **argv) {
  int fd = open("./1.txt", O_RDWR);
  int status;
  status = fcntl(fd, F_GETFL);
  status |= O_APPEND;
  fcntl(fd,F_SETFL,status);

  int ret = write(fd, "123456", 6);
  ret++;
  close(fd);
  return 0;
}
